//----------car对象
function Car(carColor,carDire,carNum){
	var obj=new Object();
	obj.name=0
	obj.carColor=carColor
	obj.carDire=carDire
	obj.carNum=carNum
	obj.speed=0.04
	obj.imgWidth=0
	obj.imgHeigh=0
	obj.loop=1
	obj.carPointx=1
	obj.carPointy=1
	
	obj.carPointx=returnPoint(obj.carDire,obj.carNum).x
	
	obj.carPointy=returnPoint(obj.carDire,obj.carNum).y
	alert(obj.carPointx+"+"+obj.carPointy)
	
	var imgSrc="img/"+this.carDire+"/"+this.carColor+".png"
	obj.pic=gameMonitor.im.createImage(imgSrc)
	
	
	obj.paint=function(ctx){
//	     console.log("绘制一辆车"+this.carPointx+this.carPointy)
//	     ctx.drawImage(this.pic,this.carPointx,this.carPointy,this.imgWidth,this.height)
         }
	
	obj.move=function(ctx){
//		//分组判断 进行求速度
//	var _this=gameMonitor
//	switch(this.carDire){
//		case carDirection[0]:
//		     this.carPointy+=this.loop*this.speed;
//		     break;
//		case carDirection[1]:
//		     this.carPointx-=this.loop*this.speed;
//		     break;
//		case carDirection[2]:
//		     this.carPointy-=this.loop*this.speed;
//		     break;
//		case carDirection[3]:
//		     this.carPointx+=this.loop*this.speed;  
//		     break;
//	}
//	
//	//判断有无车辆跑出规定范围
//	if(carNorthOneList[0].carPointy>_this.canvasHeigh){
//		carNorthOneList[0].remove()
//	}
//	if(carNorthTwoList[0].carPointy>_this.canvasHeigh){
//		carNorthTwoList[0].remove()
//	}
//	
//	if(carEastOneList[0].carPointx<0){
//		carEastOneList[0].remove()
//	}
//	if(carEastTwoList[0].carPointx<0){
//		carEastTwoList[0].remove()
//	}
//	
//	if(carSouthOneList[0].carPointy<0){
//		carSouthOneList[0].remove()
//	}
//	
//	if(carSouthTwoList[0].carPointy<0){
//		carSouthTwoList[0].remove()
//	}
//	
//	if(carWestOneList[0].carPointx>_this.canvasWidth){
//		carWestOneList[0].remove()
//	}
//	if(carWestTwoList[0].carPointx>_this.canvasWidth){
//		carWestTwoList[0].remove()
//	}
	}
	switch(carDire){
		case carDirection[0]:
		case carDirection[2]:
		      this.imgWidth=_this.carHeigh
		      this.imgHeigh=_this.carWidth
			  break;
	    case  carDirection[1]:
	    case  carDirection[3]:
	          this.imgWidth=_this.carWidth
		      this.imgHeigh=_this.carHeigh
		      break;
	}
	return obj
}